home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbfwdsr.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-03-07  |  3.6 KB  |  80 lines

  1. (*===========================================================================*)
  2. (* Forward task -- Slave Task routine                                        *)
  3. (*                                                                           *)
  4. (*   Copyright 1988, 1989, 1990, 1991, 1992 by H. Roy Engehausen.  All       *)
  5. (*   rights reserved.                                                        *)
  6. (*                                                                           *)
  7. (*===========================================================================*)
  8.  
  9. (*===========================================================================*)
  10. (* This starts the slave task                                                *)
  11. (*===========================================================================*)
  12.  
  13. PROCEDURE forward_to_remote;
  14.  
  15.   VAR
  16.     path_common : path_block_ptr;
  17.  
  18.   BEGIN;
  19.  
  20.     path_common := path_common_temp;
  21.  
  22.     (*-----------------------------------------------------------------------*)
  23.     (* Initialize the control blocks                                         *)
  24.     (*-----------------------------------------------------------------------*)
  25.  
  26.     active_port^.connected^[active_tcb^.channel] := active_tcb;
  27.     IF (active_port^.port_type = port_modem)
  28.                              OR (active_port^.port_type = port_null_modem) THEN
  29.       active_port^.cr_timeout := 1;
  30.  
  31.     active_tcb^.tcb_type            := th_fwd_slave;
  32.     active_tcb^.tcb_name            := path_common^.path_target;
  33.     active_tcb^.window              := window_connect;
  34.     active_tcb^.tcb_connect         := TRUE;
  35.     active_tcb^.uid_data.user_id    := path_common^.path_call;
  36.     active_tcb^.uid_data.user_ssid  := '';
  37.     active_tcb^.uid_data.user_class := user_c_bu;
  38.     active_tcb^.uid_data.user_flag  := user_f_bbs;
  39.  
  40.     (*-----------------------------------------------------------------------*)
  41.     (* Allow some other catchup work to clear                                *)
  42.     (*-----------------------------------------------------------------------*)
  43.  
  44.     task_switch;
  45.     task_switch;
  46.  
  47.     (*-----------------------------------------------------------------------*)
  48.     (* Delay as needed to let any outstanding packets clear.                 *)
  49.     (*-----------------------------------------------------------------------*)
  50.  
  51.     IF (path_common^.path_delay)
  52.                              AND (active_port^.port_type <> port_g8bpq)
  53.                              AND (active_port^.port_type <> port_bpqhost) THEN
  54.         BEGIN;
  55.           task_wait(opt_block.fwd_delay, FALSE);
  56.           path_common^.path_delay := FALSE;
  57.         END;
  58.  
  59.     (*-----------------------------------------------------------------------*)
  60.     (* Main forwarding                                                       *)
  61.     (*-----------------------------------------------------------------------*)
  62.  
  63.     forward_main(path_common);
  64.  
  65.     (*-----------------------------------------------------------------------*)
  66.     (* Reverse forward if Advanced BBS and it requests it or it is a PBBS    *)
  67.     (*-----------------------------------------------------------------------*)
  68.  
  69.     IF ((active_tcb^.tcb_abbs) AND (active_tcb^.tcb_bid_level > 0))
  70.                 OR ((active_tcb^.uid_data.user_flag AND user_f_pbbs) <> 0) THEN
  71.       forward_rev(path_common);                  (* forward_rev never exits! *)
  72.  
  73.     (*-----------------------------------------------------------------------*)
  74.     (* Done                                                                  *)
  75.     (*-----------------------------------------------------------------------*)
  76.  
  77.     end_session(TRUE);
  78.  
  79.   END;
  80.